<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="../template/default.xhtml">
	<ui:define name="navigation">
		<ui:include src="../navigation/simpleNavigation.xhtml"></ui:include>
	</ui:define>
	<ui:define name="content">
		<f:view>
			<h:form>
				<h:dataTable value="#{userMB.userList}" var="user">
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{msg.id}" />
						</f:facet>
						<h:outputText value="#{user.key.id}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{msg.firstname}" />
						</f:facet>
						<h:outputText value="#{user.firstname}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{msg.surname}" />
						</f:facet>
						<h:outputText value="#{user.surname}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{msg.email}" />
						</f:facet>
						<h:outputText value="#{user.email}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{msg.pseudonym}" />
						</f:facet>
						<h:outputText value="#{user.pseudonym}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{msg.password}" />
						</f:facet>
						<h:outputText value="#{user.password}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{msg.roles}" />
						</f:facet>
						<ui:repeat var="role" value="#{user.roles}">
							<h:outputText value="#{role} " />
						</ui:repeat>
					</h:column>
					<h:column>
						<h:commandLink value="#{msg.edit}" action="#{userMB.editUser}">
							<f:setPropertyActionListener target="#{userMB.currentUser}"
								value="#{user}" />
						</h:commandLink>
						<h:commandLink value="#{msg.delete}" action="#{userMB.deleteUser}">
							<f:setPropertyActionListener target="#{userMB.currentUser}"
								value="#{user}" />
						</h:commandLink>
					</h:column>
				</h:dataTable>
				<h:commandButton action="#{userMB.refresh}" value="#{msg.refresh}" />
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>
</html>